//
//  ViewController.m
//  广告
//
//  Created by JiaKang.Zhong on 15/12/24.
//  Copyright © 2015年 JiaKang.Zhong. All rights reserved.
//

#import "ViewController.h"
#import <iAd/iAd.h>
@interface ViewController ()<ADBannerViewDelegate>

@property(nonatomic,strong) ADBannerView * iadView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    _iadView = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];
   
    _iadView.delegate = self;
    [self.view addSubview:_iadView];
}

#pragma mark 广告即将进行加载
-(void)bannerViewWillLoadAd:(ADBannerView *)banner{
        NSLog(@"%s",__func__);
}

#pragma mark 广告加载成功
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
        NSLog(@"%s",__func__);
}

#pragma mark 广告加载失败
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
        NSLog(@"%s\t %@",__func__,error);
}

#pragma mark 广告关闭
-(void)bannerViewActionDidFinish:(ADBannerView *)banner{
    NSLog(@"%s",__func__);
}

@end
